﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace WebMvc_Survey.Controllers
{
    /// <summary>
    /// 登录
    /// </summary>
    public class LoginController : Controller
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            return View();
        }

        public void WeiXin(string userid, string username)
        {
            if (string.IsNullOrEmpty(userid) || string.IsNullOrEmpty(username))
                Response.Redirect("/Login");

            Response.Cookies.Append("UserId", userid);
            Response.Cookies.Append("UserName", username);

            Response.Redirect("/Home/FormResult");
        }
    }
}
